/*
 * MyTableModel.java
 *
 * Copyright 2011 Universidad Francisco de Paula Santander (UFPS).
 * Todos los Derechos Reservados.
 * Creado el 10/03/2011, 11:23:38 AM
 */

package com.ufps.cuatro.util.model;

import com.ufps.cuatro.modelo.asistente.ContenedorRegistroTabla;

/**
 * <i><b>MyTableModel:</b></i> @DefinicionClase
 * @author Carlos A. Torres C. - Dolly E. Guerrero. <https://code.google.com/p/tesis4dor/>
 * @version 1.0 10/03/2011 
 * @see MyTableModel
 */
public class MyTableModelDistribucionGridBagConstraints extends MyTableModel {
    private static final long serialVersionUID = 875227410783782538L;

    public MyTableModelDistribucionGridBagConstraints(String[] columnNames, Object[][] data, boolean[][] indicesNoEditables) {
        super(columnNames, data, indicesNoEditables);
    }

    public MyTableModelDistribucionGridBagConstraints(String[] columnNames, Object[][] data) {
        super(columnNames, data);
    }   

    /*
     * Don't need to implement this method unless your table's
     * editable.
     */
    @Override
    public boolean isCellEditable(int row, int col) {
        //Note that the data/cell address is constant,
        //no matter where the cell appears onscreen.
        try{
            if(this.indicesNoEditables == null && (this.data[row][col] instanceof ContenedorRegistroTabla)){
                ContenedorRegistroTabla obj = (ContenedorRegistroTabla) this.data[row][col];
                return obj.isEditable();
            }
            else if(this.indicesNoEditables != null){
                return this.indicesNoEditables[row][col];
            }
            return false;
        }catch(java.lang.Exception ex){}
        return false;
    }

    

}
